package com.yangye.otherdemo.datehourdemo;

import java.util.Calendar;
import java.util.Date;

/**
 * @author yangye
 * @date 2019/11/21 0021
 */
public class DateHourDemo {

	public static void main(String[] args) {
		int i1 = 1000;
		int i2 = 1000;
		System.out.println(i1 == i2);
	}

	public static int getHour(Date date) {
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(date);
		return calendar.get(Calendar.HOUR_OF_DAY);
	}

	public static int getMinute(Date date) {
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(date);
		return calendar.get(Calendar.MINUTE);
	}
}
